<h2>Libros - Editar</h2>

<form action="index.php">
<fieldset>
<input type="hidden" name="module" value="books" />
<input type="hidden" name="action" value="update" />
<input type="hidden" name="id" value="<?php echo $row->id;?>" />
<legend>Editar libro</legend>
<label for="name_input">Nombre</label>
<input id="name_input" type="text" name="name" value="<?php echo $row->name;?>" placeholder="Nombre" />
<label for="categories_id_select">Categor&iacute;a</label>
<select id="categories_id_select" name="categories_id">
<?php foreach($categories as $c):?>
<option value="<?php echo $c->id;?>" <?php echo $row->categories_id==$c->id ? 'selected' : '';?>><?php echo $c->name;?></option>
<?php endforeach;?>
</select>
<span class="help-block">
<button class="btn btn-primary" type="submit">Actualizar</button>
<a class="btn" href="index.php?module=books">Cancelar</a>
</span>
</fieldset>
</form>

